package com.hongsen.cn.presenter;

import com.hongsen.cn.base.BaseModel;
import com.hongsen.cn.base.BaseObserver;
import com.hongsen.cn.base.BasePresenter;
import com.hongsen.cn.bean.BaseTitleBean;
import com.hongsen.cn.bean.CheckBean;
import com.hongsen.cn.bean.OrderBean;
import com.hongsen.cn.contract.RefreshFaceView;

import java.util.List;

public class RefreshFacePresenter extends BasePresenter<RefreshFaceView> {

    public RefreshFacePresenter(RefreshFaceView baseView) {
        super(baseView);
    }

    /**
     * 角色预约
     */
    public void getList(final String type) {
        addDisposable(restApi.getCheckList(type), new BaseObserver(baseView) {
            @Override
            public void onSuccess(Object o) {
                BaseModel<List<CheckBean>> model = (BaseModel<List<CheckBean>>) o;
                baseView.getListByTime(model.getData());
            }

            @Override
            public void onError(String msg) {
                // baseView.showError(msg);
            }
        });
    }

    /**
     * 今日违规、加戴械具、动态人员、出所人员数量
     */
    public void getTitleInfo() {
        addDisposable(restApi.getTopPersonalData(), new BaseObserver(baseView) {
            @Override
            public void onSuccess(Object o) {
                BaseModel<BaseTitleBean> model = (BaseModel<BaseTitleBean>) o;
                baseView.getTitleInfo(model.getData());
            }

            @Override
            public void onError(String msg) {
                //baseView.showError(msg);
            }
        });
    }
}
